<include file="common/header"/>
<div style="text-indent:10px;background:#EAEDF1;width:100%;position:fixed;top:0px;height:35px;line-height:35px;">
    <a href="{:U('Index/home')}" target="right-page" style="color:#5c5c5c;text-decoration:none;">
	    <img style="position:relative;top:-2px;" src="{:C('HOME_IMAGE')}icon/sy_icon.png" width="15px;">
	    {$Think.lang._HOME_PAGE}
    </a>
    &gt;
    <a href="{:U($nav_one['action'],array('nav_id'=>$nav_one['id']))}" target="right-page" style="color:#5c5c5c;text-decoration:none;">
    	员工管理
    </a>
    &gt;
    <a href="{:U($nav_two['action'],array('nav_id'=>$nav_two['id']))}" target="right-page" style="text-decoration:none;">
    	<span style="color:#15b6be;">获取员工信息</span>
    </a>
    <span style="float:right;margin-right:10px;cursor:pointer;" onclick="location.reload()"><eq name="LANG_SET" value="zh-cn">刷新<else/>refresh</eq></span>
	<div style="display: inline-block;float: right;"><input id="search" value="" style="height:25px"/><a id="search_url"><span class="glyphicon glyphicon-search" style="right:30px;cursor:pointer" aria-hidden="true"></span></a></div>
</div>

<div class="body" style="background:#f5f5f5;padding-top: 45px;">
<table style="width:100%;">
	<tr>
		<th>{$Think.lang.USER_ACTION}</th>
		<th>{$Think.lang.USER_NUM}</th>
		<th>{$Think.lang.USER_PIC}</th>
		<th>{$Think.lang.USER_NAME}</th>
		<th>{$Think.lang.USER_NICKNAME}</th>
		<th>{$Think.lang.USER_PHONE}</th>
		<th>{$Think.lang.USER_EMAIL}</th>
		<th>{$Think.lang.USER_SEX}</th>
		<th>{$Think.lang.USER_ACTION_DELETE}</th>
	</tr>
	<volist name="list" id="vo">
	<tr>
		<td class="opration" style="">
			<a class="edits" url="{:U('Yhgl/edit',array('id'=>$vo['id']))}" href="javascript:;">
				<img title="{$Think.lang._EDIT}" src="{:C('HOME_IMAGE')}icon/editor@2x.png" style="margin-bottom:5px;height:14px;width:auto;"/>
			</a><br/>
			<a style="display: none" class="del" data_id="{$vo.id}" href="javascript:;">
				<img title="{$Think.lang._DELETE}" src="{:C('HOME_IMAGE')}icon/delete@2x.png" style="margin-bottom:5px;height:14px;width:auto;"/>
			</a>
			<!--<a class="jcbg" time="{$vo['report_time']}" uid="{$vo['uid']}" url="{$vo['report_url']}" href="javascript:;">
				<img title="{$Think.lang.YHGL_JCBG}" src="{:C('HOME_IMAGE')}icon/-report-regimen@2x.png" style="height:14px;width:auto;"/>
			</a><br/>-->
		</td>
		<td>{$vo.id}<span class="spacess"></span></td>

		<td>
			<notempty name="vo.head_pic">
			<img class="head_pic" src="{$vo.head_pic}" width="50px" height="50px">
			<else/>
			<img class="head_pic" src="{:C('HOME_IMAGE')}default_user.png" width="50px" height="50px">

			</notempty>
			<span class="spacess"></span>
		</td>
		<td>{$vo.name}<span class="spacess"></span></td>
		<td>{$vo.nickname}<span class="spacess"></span></td>
		<td>{$vo.phone}<span class="spacess"></span></td>
		<td>{$vo.email}<span class="spacess"></span></td>
		<td>
			<eq name="vo.sex" value="1">
			{$Think.lang.USER_MAN}
			</eq>
			<eq name="vo.sex" value="2">
			{$Think.lang.USER_WOMAN}
			</eq>
			<span class="spacess"></span>
		</td>
		<td><a  class="del" data_id="{$vo.id}" href="javascript:;">
			<img title="{$Think.lang._DELETE}" src="{:C('HOME_IMAGE')}icon/delete@2x.png" style="margin-bottom:5px;height:14px;width:auto;"/>
		</a></td>
		<!-- <td>
			<a class="edits" url="{:U('Yhgl/edit',array('id'=>$vo['id']))}" href="javascript:;">{$Think.lang._EDIT}</a>
			<a class="del" data_id="{$vo.id}" href="javascript:;">{$Think.lang._DELETE}</a>
			<a class="zlfa" url="{:U('Yhgl/zlfa',array('id'=>$vo['id']))}" href="javascript:;">{$Think.lang.YHGL_ZLFA}</a>
		</td> -->
	</tr>
	</volist>
</table>
<div class="page">{$page}</div>
</div>

<script>
  function extractTime(url){
	var fields=url.split('/');
    return fields[fields.length-2];
  }
  $('.del').each(function(){
	  $(this).click(function(){
		  var id = $(this).attr('data_id');
		  var url ="{:U('Yhgl/del')}";
		  var data={id:id};
		  parent.layer.confirm('{$Think.lang.USER_DELETE}？',function(){
			  $.post(url,data,function(res){
				  parent.layer.msg(res.msg,{time:2000},function(){
					  location.reload();
				  })
			  })
		  })
	  })
  })
  $('table').on('click','.edits',function(){
		  var url = $(this).attr('url');
		  parent.layer.open({
				title:'{$Think.lang.USER_UPDATE}',
			    type: 2,
			    area: ['450px', '500px'],
			    fixed: false, //不固定
			    maxmin: true,
			    shadeClose: true,
			    content: url,
			    end:function(){
			    	location.reload();
			    }
			  });
  })
  $('table').on('click','.zlfa',function(){
	  var url =$(this).attr('url');
	  parent.layer.open({
			title:'{$Think.lang.YHGL_ADD_ZLFA}',
		    type: 2,
		    area: ['450px', '360px'],
		    fixed: false, //不固定
		    maxmin: true,
		    shadeClose: true,
		    content: url,
		    end:function(){
		    	location.reload();
		    }
		});
  })
  $('table').on('click','.lsjcbg',function(){
	  var url =$(this).attr('url');
	  var newest_re =$(this).attr('newest_re');
	  var fdStart = newest_re.indexOf("http");
	  if(fdStart == 0){
		parent.layer.open({
			title:'查看用户检测报告记录',
		    type: 2,
		    area: ['700px', '380px'],
		    fixed: false, //不固定
		    maxmin: true,
		    shadeClose: true,
		    content: url,
		    end:function(){
		    	location.reload();
		    }
		});
	  }else{
		  if(fdStart == -1){
			  parent.layer.open({
              title:'{$Think.lang.YHGL_VIEW_JCBG}',
              type: 1,
              area: ['450px', '300px'],
              fixed: false, //不固定
              maxmin: true,
              shadeClose: true,
              content: '没有该用户上传的检测报告',
              end:function(){
                  location.reload();
              }
          });
		  }
	  }

  })
  $('#search_url').on('click',function(){
	  var $key_word = $('#search').val();
	  var url = "{:U('Yhgl/info',array('key_word' => $key_word))}";
	  window.location.href = url+'?key_word='+$key_word;
  })
  $("#search").keydown(function(){
	if(event.keyCode == "13"){
		var $key_word = $('#search').val();
		var url = "{:U('Yhgl/info',array('key_word' => $key_word))}";
		window.location.href = url+'?key_word='+$key_word;
	}
  })
//   $('table').on('click','.jcbg',function(){
//       var url =$(this).attr('url');
// 	  var time =$(this).attr('time');
// 		var uid =$(this).attr('uid');
// 		var downloadUrl="{:U('Api/ZyApi/download_jcbg')}?uid="+uid;
// 	  var newDate = new Date();
// 	  newDate.setTime(time * 1000);
// 	  var date = newDate.toLocaleString();
//       var fdStart = url.indexOf("http");
// 	  var timeSpan = extractTime(url);
//       if(fdStart == 0){
//           parent.layer.open({
//               title:'{$Think.lang.YHGL_VIEW_JCBG}'+'[上传时间：'+date+']'
// 										+'<a style="margin-left:10px;" href="'
// 										+'{:U("Api/ZyApi/download_jcbg")}?uid='+uid
// 										+'">下载json数据</a>',
//               type: 2,
//               area: ['900px', '500px'],
//               fixed: false, //不固定
//               maxmin: true,
//               shadeClose: true,
//               content: url,
//               end:function(){
//                   location.reload();
//               }
//           });
//       }else if(fdStart == -1){
        //   parent.layer.open({
        //       title:'{$Think.lang.YHGL_VIEW_JCBG}',
        //       type: 1,
        //       area: ['450px', '300px'],
        //       fixed: false, //不固定
        //       maxmin: true,
        //       shadeClose: true,
        //       content: '没有该用户上传的检测报告',
        //       end:function(){
        //           location.reload();
        //       }
        //   });
//       }

//   })

//鼠标放上图片变大
big_img1();
</script>
